﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Gola.VN.Scb.Web.Common.Models.UIProductModels>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: ViewData["Title"] %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="/Scripts/compare/compareProduct.js"></script>
    <script type="text/javascript">
        function displayProduct(id) {
            // 1. get data from current
            var itemCount = parent.document.getElementById('itemCount').value;
            var itemIndex = parent.document.getElementById('itemIndex').value;
            var objIds = getIds(parent.location.href);
            var arrIds = objIds.split('-');
            var strLink = '';

            // process data
            if (arrIds.length <= itemIndex) { // add new position
                strLink = parent.location.href + '-' + id;
                parent.document.getElementById('itemCount').value = itemCount + 1;
            }
            else { // replace a existed position
                strLink = replaceId(parent.location.href, arrIds, itemIndex, id);
            }

            // 3. close popup
            parent.location.href = strLink;
        }
    </script>
    <% Html.RenderPartial("ProductsGridUserControl", Model.Products); %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftPanel" runat="server">
    <%--  <%Html.RenderPartial("FilterPanel", Model.FilterData); %>--%>
</asp:Content>
